home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-15 / advdiag.zip / ADVDIAG.DOC < prev    next >
Text File  |  1992-07-04  |  18KB  |  433 lines

  1.  
  2.  
  3.                                    DIAGS.EXE
  4.  
  5.              Special Serial, Parallel, Video diagnostics for the PC
  6.  
  7.           Written by Joan Riff for:
  8.  
  9.           Computerwise Consulting Services
  10.           P.O. Box 813, McLean, VA 22101
  11.           (703) 280-2809
  12.  
  13.      Introduction
  14.      ____________
  15.  
  16.      DIAGS is a tool for the advanced PC user, period. It is NOT for the
  17.      general public. This manual will not explain things in elementary terms.
  18.      If you know what a 6845 is, and what an 8250 is, and what parallel
  19.      handshaking lines are, then DIAGS will be extremely useful to you. If
  20.      not, then you may have better things to do with your time than try to
  21.      figure out this program.
  22.  
  23.      DIAGS started out as a testbed for our new interrupt-driven RS232
  24.      libraries. The Serial Port Diagnostics were the first written, to test
  25.      the Microsoft version 3.0 'C' interface to these routines.
  26.  
  27.      It has since grown. As we have added more assembler routines to our
  28.      library, we have added corresponding DIAGS functions to test them.
  29.  
  30.      Additionally, DIAGS has been expanded as we experienced the need for new
  31.      diagnostics capabilities. So the Parallel Port diagnostics were added
  32.      when we had to debug yet another unknown printer's handshaking. And the
  33.      6845 diagnostics were added when we needed to test various video tricks
  34.      like displaying 30 lines of text, smooth scrolling, etc.
  35.  
  36.      As it now stands, DIAGS is a very powerful facility for:
  37.  
  38.           1) Testing all sorts of asynch communications lines
  39.  
  40.           2) Testing printer handshaking and cable wiring
  41.  
  42.           3) Examining an unknown system's DOS environment, including:
  43.  
  44.                a) Interrupt vectors
  45.                b) Resident device handlers
  46.  
  47.           4) Directly manipulating the 6845.
  48.  
  49.      Main Menu
  50.      _________
  51.  
  52.      The main DIAGS menu displays information about the machine and about
  53.      DOS, and presents a list of the various diagnostics that are available.
  54.      When you exit a particular diagnostic, you are returned to this main
  55.      menu.
  56.  
  57.      (D)isk Info
  58.      ___________
  59.  
  60.      Let's describe the weakest and least important diagnostic first.
  61.  
  62.      The DISK INFO selection from the main menu displays just about every-
  63.      thing that can be determined about a disk. Make sure that you have a
  64.      diskette in the indicated drive before selecting this option.
  65.  
  66.      Since there are other utilities which do just about everything that you
  67.      may want to do with a disk, we haven't done much with this diagnostic.
  68.      We just display disk information as reported by DOS as well as by the
  69.      disk's Boot Record.
  70.  
  71.      Once in the Disk Info screen, the following keypresses are available to
  72.      you:
  73.  
  74.           ESC - return to the main DIAGS menu
  75.           ESC
  76.  
  77.           ALT-V - verify a diskette by reading every sector via DOS INT
  78.           ALT-V
  79.           025h. This is SLOW!!!! Think of this as a demo of just how
  80.           slow INT 025h can be.
  81.  
  82.           ALT-R - reset drive. Doesn't do much, huh? That's what we
  83.           ALT-R
  84.           wanted to see.
  85.           A thru Z - select new drive for which statistics are to be
  86.           A      Z
  87.           displayed. Again, be sure that you have a disk in whatever
  88.           drive you select.
  89.      That's it. Not much to it. If you need to do more, then use:
  90.  
  91.           The Norton Utilities
  92.           Quaid's Disk Explorer
  93.           Central Point Software's Option Board
  94.  
  95.      (I)nterrupt Vector Display
  96.      __________________________
  97.  
  98.      This selection from the main menu displays the system's Interrupt
  99.      Vectors. For each interrupt, the following information is displayed:
  100.  
  101.           The interrupt number
  102.           The interrupt vector's address within segment zero
  103.           The Segment:Offset of its handler
  104.           The interrupt's name and/or use
  105.  
  106.      If an interrupt points to an IRET, then that fact is reported by a
  107.      highlighted "[IRET]" displayed after the name.
  108.                   [IRET]
  109.  
  110.      Once in the Interrupt screen, the following keypresses are available to
  111.      you:
  112.  
  113.           ESC - exit back to main menu
  114.           ESC
  115.           Home - scroll display back to Interrupt 0
  116.           Home
  117.           End - scroll display to the end of the interrupts (F0 thru FF)
  118.           End
  119.           PgDn - scroll to the next page of vectors
  120.           PgDn
  121.           PgUp - scroll up to the previous page of vectors
  122.           PgUp
  123.           Up Arrow - scroll up 1 line
  124.           Up Arrow
  125.           Down Arrow - scroll down 1 line
  126.           Down Arrow
  127.  
  128.      (P)arallel Diagnostics
  129.      ______________________
  130.  
  131.      This is a more complicated set of diagnostics. It allows you to do all
  132.      sorts of useful things with the parallel ports. We use these routines
  133.      when we're trying to figure out whether or not some new printer is
  134.      working properly with the system.
  135.  
  136.      At the top of the screen is displayed:
  137.  
  138.           The number of parallel ports on the system (1 thru 4)
  139.           The number of the currently-selected printer (0 thru 3)
  140.           The base I/O address of the currently-selected printer
  141.           The trip character that is currently set (see below)
  142.           Whether interrupts are allowed or disallowed during sampling
  143.  
  144.      The Parallel Port Diagnostics menu gives you the following choices:
  145.  
  146.           (I)nit printer - does a ROM BIOS "init printer" call.
  147.           (I)nit printer
  148.  
  149.           (E)nable Interrupts during sampling - toggles the indicator on
  150.           (E)nable Interrupts during sampling
  151.           the top line, which indicates whether INTs are to be dis-
  152.           allowed during sampling.
  153.  
  154.           (N)ew Trip character - allows you to specify a new character
  155.           (N)ew Trip character
  156.           to be sent to the printer to 'trip' it. This is initially a
  157.           Linefeed.
  158.  
  159.           (P)rinter switch - selects next printer (in sequence) as the
  160.           (P)rinter switch
  161.           current printer.
  162.           (T)rip printer - sends the current Trip character to the
  163.           (T)rip printer
  164.           printer, and then captures the printer Status port lines using
  165.           a special high-speed capture routine. These lines are dis-
  166.           played in oscilloscope format, allowing you to see at a glance
  167.           the operation of the BUSY line, ACK line, etc. Interrupts will
  168.           be inhibited during the sampling if the top line of the
  169.           display shows "No Ints". Press ESC to exit from the display of
  170.           the status lines.
  171.  
  172.           (U)nique Printer setup - sends custom codes to set various
  173.           (U)nique Printer setup
  174.           specific printers into various modes. The printers currently
  175.           supported are:
  176.                Data Products 8070 (and perhaps IDS Color Prism)
  177.                IBM Graphics Printer (and certain Epsons)
  178.                Fujitsu DL-2600 (and perhaps Epson JX color series)
  179.                Okidata Microline 93
  180.                Diable 630 (and C.ITOH Starwriter, F-10, etc)
  181.                C.ITOH Prowriter
  182.  
  183.           Follow the prompts that are displayed when you make this
  184.           selection.
  185.  
  186.           (Q)uit parallel diagnostics - to return to main menu
  187.           (Q)uit parallel diagnostics
  188.  
  189.           The following three selections are invaluable for checking
  190.           proper printer cabling and handshaking:
  191.  
  192.           (D)ata lines - displays the parallel port Data I/O port lines
  193.           (D)ata lines
  194.           in oscilloscope-like format. Press ESC to exit the oscillo-
  195.           scope display.
  196.  
  197.           (S)tatus lines - as above, but lines displayed are from
  198.           (S)tatus lines
  199.           the parallel Status I/O port.
  200.  
  201.           (C)ontrol lines - as above, but lines displayed are from
  202.           (C)ontrol lines
  203.           parallel Control I/O port.
  204.  
  205.           The following selections send various strings to the printer:
  206.  
  207.           (F)ox message - sends a continuous FOX message to the printer
  208.           (F)ox message
  209.           via direct I/O (bypassing the ROM BIOS). Press ESC to stop it.
  210.  
  211.           (A)scii character set - sends the complete ASCII character set
  212.           (A)scii character set
  213.           to the printer via direct I/O (bypassing the ROM BIOS). No
  214.           carriage returns are sent. Press ESC to stop it.
  215.  
  216.           (H)oriz and vert alignment tests - send various Formfeed, Tab,
  217.           (H)oriz and vert alignment tests
  218.           line spacing and Backspacing sequences to printer. This is
  219.           useful for testing the results of (U)nique printer setups, and
  220.                                             (U)nique
  221.  
  222.           to see if the printer supports true backspacing. This selec-
  223.           tion has its own submenu, which is exited via ESC.
  224.  
  225.      (S)erial Port Diagnostics
  226.      _________________________
  227.  
  228.      If you do PC communications as much as we do, then this part of DIAGS is
  229.      for you! It provides a very powerful look at the comm line. Its most
  230.      intriguing feature is the ability to serve as a line monitor between two
  231.      serial devices.
  232.  
  233.      When you select "Serial Diagnostics" from the main menu, your screen
  234.      becomes a terminal screen. At the top of the screen is displayed various
  235.      port information as follows:
  236.  
  237.           Whether the port is open ("OP") or closed ("CL")
  238.           The current serial port number
  239.           The current baud rate
  240.           The number of data bits being used
  241.           The type of parity being used
  242.           The number of stop bits being used
  243.           Whether the existing 8250 parameters are being re-used (this
  244.                feature is only used by us, for internal testing)
  245.           What port is being wrapped to (more on this later)
  246.           Whether keypresses are echoed to the screen
  247.           Whether DEBUG mode (HEX display) is set
  248.  
  249.      To the right of this information are various stats, displayed only if
  250.      the port is open and stats have been enabled. These stats include:
  251.  
  252.           The size of the RS232 output queue (in HEX)
  253.           The size of the RS232 input queue (in HEX)
  254.           The status of Carrier Detect and DSR
  255.           The number of times (in HEX) that the following have occurred:
  256.  
  257.                RING
  258.                BREAK
  259.                Framing Error
  260.                Parity Error
  261.                Overrun Error
  262.      Once the port has been opened, any "normal" keys that you press are sent
  263.      over the comm line by being queued into the output queue. Incoming data
  264.      appears on the screen. Incoming and outgoing characters are displayed in
  265.      different colors, so that you can tell what's what.
  266.  
  267.      The RS232 routines are entirely interrupt-driven. The output queue will
  268.      be serviced only if the 8250 is properly interrupting the 8088. This in
  269.      itself is a valuable test of proper system operation. If the output or
  270.      input queue sizes stay "stuck" at a non-zero value, then something is
  271.      wrong with your system.
  272.  
  273.      Besides the "normal" keys, you may use the following keypresses:
  274.  
  275.           ALT-S - switch display between port 0 and port 1 (COM1: and
  276.           ALT-S
  277.           COM2:).
  278.  
  279.           ALT-M - bring up a menu of miscellaneous features:
  280.           ALT-M
  281.  
  282.                HANGUP the phone by dropping DTR
  283.                PICKUP the phone by raising DTR
  284.                RESET the Hayes 1200b by OUT1 toggle
  285.                FLUSH input and output queues
  286.                CRLF control (how to display incoming CR and LF)
  287.                STATS control - turning the stats off can speed up the
  288.                     terminal display considerable
  289.                TRAP - control what happens when you press ALT-T to trap
  290.                     some 8250 register
  291.  
  292.           ALT-X - initiate an XMODEM transfer. This we use to test the
  293.           ALT-X
  294.           accuracy of XMODEM as implemented in other software packages.
  295.  
  296.           ALT-P - control port parameters. This includes:
  297.           ALT-P
  298.  
  299.                port OPEN and CLOSE
  300.                BAUDRATE
  301.                DATA bit selection
  302.                PARITY setting
  303.                STOP bit selection
  304.                REUSE of the 8250 params (for our internal use)
  305.                ECHO (of local keypresses) on/off
  306.                WRAP of incoming data to another comm port
  307.                DEBUG display toggle
  308.  
  309.           ALT-T - to trap the data lines from a previously-defined 8250
  310.           ALT-T
  311.           register
  312.  
  313.           ALT-R - display various 8250 registers
  314.           ALT-R
  315.  
  316.           ALT-B - to send a BREAK
  317.           ALT-B
  318.  
  319.           ALT-W - wait (do nothing) till next keypress. This is useful
  320.           ALT-W
  321.           for pausing a fast-miving display.
  322.  
  323.           ALT-Q - quit back to main menu
  324.           ALT-Q
  325.  
  326.           ALT-F - send a single FOX message over comm line
  327.           ALT-F
  328.  
  329.      Most of these functions contain their own prompts, and require no
  330.      further explanation. Some, however, need to be explained in detail.
  331.  
  332.      The continuous updating of the stats on the top line can slow down the
  333.      terminal display. Turning stats off (ALT-M S) can speed things up
  334.      considerably.
  335.  
  336.      The baud rate is continuously variable, from 2 to 38400. You are not
  337.      limited to "standard" PC baud rates.
  338.  
  339.      If you want to clear the screen and reset the stats, try switching ports
  340.      twice (ALT-S ALT-S).
  341.  
  342.      To trap and display an 8250 register in the middle of communication, you
  343.      must first define the register to be trapped (ALT-M T) and whether INTs
  344.      are to be allowed during the sampling that follows.
  345.      Having done that, you cause the trap by pressing ALT-T. At that instant,
  346.      a special high-speed assembler routine is executed which samples the
  347.      designated register once every 50 machine cycles or so until 420 samples
  348.      have been taken. These sample bytes are then displayed as a screenful of
  349.      HEX bytes. You may highlight a particular byte via the arrow keys. The
  350.      highlighted byte's interpretation is displayed on the message line
  351.      toward the top of the screen. Press ESC to exit this trap display.
  352.  
  353.      The "wrap" feature is very useful. It may be used to allow DIAGS to
  354.      serve as a line monitor located between two serial devices, among other
  355.      things. Every incoming character is "wrapped" as an output to whatever
  356.      port you have specified as the "wrap" port. If you select as the "wrap"
  357.      port the same port that you're using, then you have in effect become a
  358.      full-duplex system. The serial device connected to that port will see
  359.      its "keypresses" echoed back to itself.
  360.  
  361.      Assuming that you have two serial ports, you may use DIAGS as a line
  362.      monitor by wrapping each port's input to the other port. You can then
  363.      switch between ports (ALT-S) and generally watch everything that goes in
  364.      either direction. You can turn on the DEBUG display (ALT-P G) to see
  365.      things in more detail.
  366.  
  367.      (R)esident device handler display
  368.      _________________________________
  369.  
  370.      This main menu selection allows you to see a list of all resident device
  371.      handlers. As you highlight each handler's name (via the left and right
  372.      arrow keys), the device's attributes are expanded on the screen. Press
  373.      ESC to exit this display.
  374.  
  375.      Block devices are indicated by device names of the form "BLOCKnnn",
  376.      where nnn is the number of devices supported by this block device
  377.      handler.
  378.  
  379.      (V)ideo Manipulation
  380.      ____________________
  381.  
  382.      If you want to do some fancy 6845 programming, then the Video diagnostic
  383.      will be of great interest to you. It allows you to examine and alter the
  384.      6845 registers in a most graphic fashion.
  385.      Toward the top of the screen is a two-column list of all 6845 registers,
  386.      and one or two of the special IBM PC video registers (the MODE and/or
  387.      COLOR registers). There is a ">" pointer, showing you which register is
  388.      being worked with.
  389.  
  390.      For each 6845 register, two values are shown:
  391.  
  392.           1) The original value, as set by the ROM BIOS
  393.           2) The current value as set by you
  394.  
  395.      You move the ">" pointer to various 6845 registers via the up and down
  396.                    >
  397.      arrow keys. As you select each 6845 register, that register's bit
  398.      pattern is expanded on the bottom half of the screen.
  399.  
  400.      You can change the currently-selected 6845 register's value by using the
  401.      "+" or "-" keypad keys to increment or decrement its value.
  402.       +      -
  403.  
  404.      You can also use the left and right arrow keys to move the "bit pointer"
  405.      across the various bits of the expanded byte on the bottom half of the
  406.      screen. Pressing "1" or "0" sets or clears the bit currently pointed
  407.                        1      0
  408.      to. This is an alternate way to change the current value of a 6845
  409.      register.
  410.  
  411.      The updated 6845 registers are loaded into the 6845 ONLY WHEN YOU PRESS
  412.      RETURN. This allows you to make extensive changes to registers without
  413.      having intermediate states foul up the display.
  414.  
  415.      If you hose things up and get an unreadable screen, just press ESC to
  416.      exit the Video Diagnostics, then enter it again. The 6845 is reset on
  417.      exit from the Video Diagnostics.
  418.  
  419.      If you are using a Color/Graphics Adapter, then you may press "S" to
  420.                                                                     S
  421.      toggle Snow on or off. The upper-right corner of the display shows the
  422.      current status of snow as follows:
  423.  
  424.           "Snow: YES" means that no effort is being made to eliminate
  425.            Snow: YES
  426.           snow, and that snow is present (although you won't see it if
  427.           you have a good Color/Graphics board)
  428.  
  429.           "Snow: NO" means that snow is being eliminated by our video
  430.            Snow: NO
  431.           software.
  432. #############################################################################